package com.yh.modules.data.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @Author: skh
 * @Date: 2020/3/31 15:49
 * @Description: 机器工作记录
 */
@Data
@TableName("tb_machine_work_record")
public class MachineWorkRecordEntity {

    @Id
    private Integer id;

    @NotNull(message = "机器id不能为空")
    private Integer machineId;

    @NotNull(message = "机器开始工作时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startTime;

    @NotNull(message = "机器结束工作时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endTime;

    @NotNull(message = "机器该时间段内生产的零件总数")
    private Integer totalCount;

    private String date;

    private Date createTime;

    //用于图表显示
    @TableField(exist = false)
    private String startTimeAndEndTime;
}
